/**
 * 
 */
package pricingEngine;

import yieldCurve.Date;
import yieldCurve.YieldCurve;
import payout.Payout;

/**
 * @author Administrator
 *
 */
public abstract class Engine {
	// volatility
	double sigma;
	
	//initial market price
	double S0;
	
	// Option start date, default is today
	Date startDate = new Date();
	
	// Option expiry date
	Date expiryDate;
	
	// Strike price
	double strike;
	
	// Yield curve
	YieldCurve yieldCurve;
	
	// interface of payout
	Payout payout;
	
	/**
	 * constructor Engine, initialize input parameters
	 * @param sigma volatility
	 * @param S0 initial stock price
	 * @param strike strike price
	 * @param yieldCurve yield curve
	 * @param startDate default is today
	 * @param expiryDate expiry date of the option
	 * @param payout payout function
	 */
	
	public Engine(YieldCurve yieldCurve, double sigma, double S0, double strike,
			Date startDate, Date expiryDate, Payout payout) {
		// TODO Auto-generated constructor stub
		this.sigma = sigma;
		this.yieldCurve = yieldCurve;
		this.S0 = S0;
		this.strike = strike;
		this.startDate = startDate;
		this.expiryDate = expiryDate;
		this.payout = payout;
	}
	
	/**
	 * The user interface for changing the option information without constructing a new engine
	 * @param S0
	 * @param strike
	 * @param startDate
	 * @param expiryDate
	 * @param payout
	 */
	public void setOptionInfo(double S0, double strike, 
			Date startDate, Date expiryDate, Payout payout) {
		this.S0 = S0;
		this.strike = strike;
		this.startDate = startDate;
		this.expiryDate = expiryDate;
		this.payout = payout;
	}
	
	abstract public double getOptionPrice();

}
